import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { ConfigQuery, ConfigPageVO, ConfigForm } from "./types";

export function getConfigPage(
  queryParams: ConfigQuery
): AxiosPromise<PageResult<ConfigPageVO[]>> {
  return request({
    url: "/api/car/config/page",
    method: "get",
    params: queryParams,
  });
}

export function saveConfig(data: ConfigForm) {
  return request({
    url: "/api/car/config/saveConfig",
    method: "put",
    data: data,
  });
}

/**
 * 删除
 *
 * @param ids
 */
export function deleteConfig(ids: string) {
  return request({
    url: "/api/car/config/" + ids,
    method: "delete",
  });
}
